package com.gupaoedu.baifc.staticproxy;

import java.util.Date;

/**
 * projectName: baifc_proxy
 * packageName: com.gupaoedu.baifc.staticproxy
 * Created: 2019/3/18.
 * Auther: baifc
 * Description:
 */
public class OrderServiceProxyTest {

    public static void main(String[] args) {

        Order order = new Order();

        order.setOrderId("111");
        order.setCreateTime(new Date());
        // 静态代理
        OrderServiceProxy orderServiceProxy = new OrderServiceProxy(new OrderService());

        orderServiceProxy.createOrder(order);

        System.out.println("==================================================");

        // 动态代理
        IOrderService orderService = (IOrderService) new OrderServiceDynamicProxy().getInstance(new OrderService());

        orderService.createOrder(order);

    }
}
